Problems with soap sample appl

Discussion in 'Java' started by leo v, May 26, 2005.

  1. leo v

    leo v Guest

    Hi,

    I'm trying to learn SOAP, however I ran into a problem that I don't know how to solve.
    I alway get the error that TheMySqlSoapServerService is not found, but is is there, it
    even tells so. It doesn't mather whether or on I schge names, add pre's etc. Could it be
    something with namespaces?

    If anyone has a hint, I would appreciate.....

    thanks,
    leo

    When I run the sample SOAPProgram SEITip, I get a messages
    ===========================================================


    could not find service: {TheMySqlSoapServer}TheMySqlSoapServerService in the specified
    WSDL file. The service names found were: {urn:TheMySqlSoapServer}TheMySqlSoapServerService
    at
    com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:108)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:62)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:48)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:41)
    at SEITip.main(SEITip.java:17)
    BUILD SUCCESSFUL (total time: 1 second)


    =============program source===================

    import java.net.URL;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.ServiceFactory;


    public class SEITip {
    public static void main(String args[]) {
    try {
    // Create a service class with WSDL information.
    QName serviceName = new QName(
    "",
    "TheMySqlSoapServerService");
    URL wsdlLocation = new URL
    ("http://11.11.111.11/Themysqlsoapcon.php?wsdl");
    ServiceFactory factory = ServiceFactory.newInstance();
    Service service = factory.createService(
    wsdlLocation,
    serviceName);
    // Get an implementation for the SEI for the given port
    QName portName = new QName("", "TheMySqlSoapServerPort");

    //next creation is generating the error
    TheMySqlSoapServerPort The = (TheMySqlSoapServerPort) service.getPort(
    portName,
    TheMySqlSoapServerPort.class);
    // Invoke the operation
    int batchnr = The.GetNewBatchNr();
    System.out.println("New batchnumber = " + batchnr);
    }
    catch (Throwable t) {
    t.printStackTrace();
    }
    }
    }


    ============This is the wsdl info: ====================
    <?xml version="1.0"?><definitions name="TheMySqlSoapServer"
    targetNamespace="urn:TheMySqlSoapServer" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:TheMySqlSoapServer"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
    </types>
    <portType name="TheMySqlSoapServerPort">
    <operation name="GetNewBatchNr">
    <input message="tns:" />
    <output message="tns:GetNewBatchNrResponse" />
    </operation>
    </portType>
    <binding name="TheMySqlSoapServerBinding" type="tns:TheMySqlSoapServerPort">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="GetNewBatchNr">
    <soap:eek:peration
    soapAction="urn:TheMySqlSoapConnection#The_mysql_soapconnection#GetNewBatchNr" />
    <input>
    <soap:body use="encoded" namespace="urn:TheMySqlSoapConnection"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:TheMySqlSoapConnection"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    </binding>
    <service name="TheMySqlSoapServerService">
    <documentation />
    <port name="TheMySqlSoapServerPort" binding="tns:TheMySqlSoapServerBinding">
    <soap:address location="http://11.11.111.11/Themysqlsoapcon.php" />
    </port>
    </service>
    <message name="GetNewBatchNrResponse">
    <part name="ResultStr" type="xsd:integer" />
    </message>
    </definitions>
     
    leo v, May 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UG9sYQ==?=
    Replies:
    1
    Views:
    649
    Mark Rae
    Aug 11, 2004
  2. =?Utf-8?B?TiBTIFM=?=
    Replies:
    3
    Views:
    570
    David Jessee
    Aug 29, 2004
  3. iusfani

    Security Appl. Block with AzMan

    iusfani, Sep 5, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,054
    iusfani
    Sep 5, 2005
  4. =?Utf-8?B?dGlu?=

    caching data that survive an appl restart

    =?Utf-8?B?dGlu?=, Jan 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    DavidG
    Jan 13, 2006
  5. Peter931
    Replies:
    1
    Views:
    635
    OHM \( One Handed Man \)
    Apr 2, 2006
Loading...

Share This Page