HI
I am developing a web service client using netbeans ide . I have used the code completion feature to implement the submit message method :
import javax.xml.bind.JAXBElement;
import uk.co.csoft.www2.dtd.sendsms5.Message;
import uk.co.csoft.www2.dtd.sendsms5.ObjectFactory;
import uk.co.csoft.www2.dtd.sendsms5.Recipient;
public class Main {
public static void main(String args[]) {
//Recipient r = new Recipient();
//Message m =new Message();
ObjectFactory factory = new ObjectFactory();
Message msg=factory.createMessage();
Recipient rt=factory.createRecipient();
JAXBElement<String> txt = factory.createMessageTextMessage("Test Message");
JAXBElement<String> to = factory.createRecipientSendTo("447700912345");
//message element order
msg.setTextMessage(txt);
msg.setFlashMessage(null);
msg.setRingtone(null);
msg.setOperatorLogo(null);
msg.setPictureMessage(null);
msg.setGroupGraphic(null);
msg.setSmsSubmitPdu(null);
msg.setWAPPush(null);
msg.setMMSNotification(null);
//recipient element order
rt.setSendTo(to);
rt.setSendCc(null);
rt.setSendBcc(null);
rt.setSendToAddressBook(null);
rt.setSendCcAddressBook(null);
rt.setSendBccAddressBook(null);
rt.setPhoneMake(null);
rt.setPhoneModel(null);
rt.setMCC(null);
rt.setMNC(null);
rt.setSendOptions(null);
try
{
submitMessage("My username", "My password", rt, msg, null, null, null, null, null, null);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
private static void submitMessage(java.lang.String username, java.lang.String pin, uk.co.csoft.www2.dtd.sendsms5.Recipient recipient, uk.co.csoft.www2.dtd.sendsms5.Message message, java.lang.String replyTo, javax.xml.ws.Holder<java.lang.String> messageIdentifier, javax.xml.ws.Holder<uk.co.csoft.www2.dtd.sendsms5.Reserved> reserved, javax.xml.ws.Holder<java.lang.String> report, javax.xml.ws.Holder<java.lang.String> text, javax.xml.ws.Holder<java.math.BigInteger> libraryNumber)
{
uk.co.csoft.www2.dtd.sendsms5.Service service = new uk.co.csoft.www2.dtd.sendsms5.Service();
uk.co.csoft.www2.dtd.sendsms5.ServicePortType port = service.getService();
port.submitMessage(username, pin, recipient, message, replyTo, messageIdentifier, reserved, report, text, libraryNumber);
}
}
The code compiles fine.When I run the code I am getting the following error:
javax.xml.ws.soap.SOAPFaultException: Method 'ns2:SubmitMessage' not implemented: method name or namespace not recognized
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)
at $Proxy36.submitMessage(Unknown Source)
at Main.submitMessage(Main.java:64)
at Main.main(Main.java:52)
The sample soap request and response recommended by them are as follows:
http://www.csoft.co.uk/sms/api/soap_to_sms.htm
and the wsdl is at:
http://www.csoft.co.uk/dtd/sendsms5.wsdl
I am not completely confident with the JAXBElement part and the object factory bit.It would be helpful if someone points out where I am going wrong.Any pointer in the right direction would be greatly appreciated.
Thanks