服务客户端调用以扩展类作为参数的操作时出现问题

发布于 2024-10-26 18:13:35 字数 921 浏览 0 评论 0原文

服务客户端调用以扩展类作为参数的操作时出现问题

我的操作输入已扩展类 xsd:shema

SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope 信封 = fac.getDefaultEnvelope(); OM 命名空间 omNs = fac.createOMNamespace( “http://impl.service.mobile.boerse.com/”,“impl”); // // 创建有效负载 OMElement 方法 = fac.createOMElement("getIndexData", omNs); OMElement 值 = fac.createOMElement("arg0.deviceType", omNs); value.setText("1"); 方法.addChild(值); OMElement value2 = fac.createOMElement("arg0.identificationID", omNs); value2.setText("1"); method.addChild(value2); OMElement value4 = fac.createOMElement("arg0.name", omNs); value4.setText("1"); 方法.addChild(value4); OMElement value3 = fac.createOMElement("arg1", omNs); value3.setText("1"); 方法.addChild(value3); 信封.getBody().addChild(方法);

哪里错了

Serviceclient problem invoking operations which have extended classes as parameters

I have operation input that have exteded class xsd:shema

SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope envelope = fac.getDefaultEnvelope();
OMNamespace omNs = fac.createOMNamespace(
"http://impl.service.mobile.boerse.com/", "impl");
// // creating the payload
OMElement method = fac.createOMElement("getIndexData", omNs);
OMElement value = fac.createOMElement("arg0.deviceType", omNs);
value.setText("1");
method.addChild(value);
OMElement value2 = fac.createOMElement("arg0.identificationID", omNs);
value2.setText("1");
method.addChild(value2);
OMElement value4 = fac.createOMElement("arg0.name", omNs);
value4.setText("1");
method.addChild(value4);
OMElement value3 = fac.createOMElement("arg1", omNs);
value3.setText("1");
method.addChild(value3);
envelope.getBody().addChild(method);

where is wrong

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南薇 2024-11-02 18:13:35

如果您有扩展类parementer,例如操作名称.anotherclass.paremeter,

首先在创建paremeter OMElement并添加paremeter anatherclass后创建anotherclass OMElement

if you have extended class parementer such as operationname.anotherclass.paremeter

at first create anotherclass OMElement after create paremeter OMElement and add paremeter anatherclass

最单纯的乌龟 2024-11-02 18:13:35

我解决了这个问题:

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;

I solved the problem:

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;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文