Problems with soap sample appl

L

leo v

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top