Hello,
I am now trying to using axis2 as client to access .net web service.
.net web service as follows:
public string HelloWorld(string name) { return "Hello World"+name; }
Axis2 client code is in the attachment.When I run the client code,I get the
following information:
- Discarding unexpected response: HTTP/1.1 100 ContinueHello
World
Could you tell me what'sthe problem?Axis2 can access .net web service?I am
waiting for your help.Thank you!
-Zhang
_________________________________________________________________
手机也能上 MSN 聊天了,快来试试吧!
http://mobile.msn.com.cn///http://ws.apache.org/axis2/mail-lists.html
public class Axis2getnet {
private static EndpointReference targetEPR = new
EndpointReference("http://localhost/test/Service1.asmx");
public static void main(String[] args) {
try {
OMElement payload = getContentOMElement();
Options options = new Options();
options.setAction("http://tempuri.org/HelloWorld");
options.setTo(targetEPR);
ServiceClient sender = new ServiceClient();
sender.setOptions(options);
OMElement result = sender.sendReceive(payload);
System.out.println(result.getFirstElement().getText());
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
}
}
public static OMElement getContentOMElement() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/", "");
OMElement method = fac.createOMElement("HelloWorld", omNs);
OMElement value = fac.createOMElement("Text", omNs);
value.addChild(fac.createOMText(value, "zhangsan"));
method.addChild(value);
return method;
}
}---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]