Serviceclient问题调用将扩展类作为参数的操作
我有扩展类xsd:shema
的操作输入SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope envelope = fac.getDefaultEnvelope(); OMNamespace omNs = fac.createOMNamespace( “http://impl.service.mobile.boerse.com/”,“impl”); // //创建有效负载 OMElement方法= fac.createOMElement(“getIndexData”,omNs); OMElement值= fac.createOMElement(“arg0.deviceType”,omNs); value.setText( “1”); method.addChild(值); OMElement value2 = fac.createOMElement(“arg0.identificationID”,omNs); value2.setText( “1”); method.addChild(值2); OMElement value4 = fac.createOMElement(“arg0.name”,omNs); value4.setText( “1”); method.addChild(值4); OMElement value3 = fac.createOMElement(“arg1”,omNs); value3.setText( “1”); method.addChild(值3); 。envelope.getBody()的addChild(方法);
哪里错了
答案 0 :(得分:0)
我解决了这个问题:
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope envelope = fac.getDefaultEnvelope();
OMNamespace omNs = fac.createOMNamespace("http://impl.service.mobile.boerse.com/", "tns");
// // creating the payload
OMElement method = fac.createOMElement("getIndexData", omNs);
OMElement arg0 = fac.createOMElement(new QName("arg0"));
OMElement value = fac.createOMElement(new QName("deviceType"));
value.setText("1");
arg0.addChild(value);
OMElement value2 = fac.createOMElement(new QName("identificationID"));
value2.setText("1");
arg0.addChild(value2);
OMElement value4 = fac.createOMElement(new QName("name"));
value4.setText("1");
arg0.addChild(value4);
OMElement arg1 = fac.createOMElement(new QName("arg1"));
arg1.setText("1");
method.addChild(arg0);
method.addChild(arg1);
envelope.getBody().addChild(method);
return envelope;
答案 1 :(得分:0)
如果您有扩展类parementer,例如operationname.anotherclass.paremeter
首先在创建paremeter OMElement之后创建另一个类OMElement并添加paremeter anatherclass