简体   繁体   English

如何使用t24格式发送SOAP请求

[英]How can I use t24 format to send SOAP request

I am working with Java Web Services. 我正在使用Java Web服务。 I got a task to create web service which will send the SOAP request in following format. 我有一个创建Web服务的任务,它将以以下格式发送SOAP请求。

 <CreateAccount>
    <field name="name">xyz abc</field>
    <field name="dob">1989-04-05</field>
    <field name="phone">9999999999</field>
    <field name="address">vvk</field>
</CreateAccount>

I created the WSDL file with types section like 我用类型部分创建了WSDL文件,例如

<wsdl:types>
<xsd:schema targetNamespace="abc">
  <xsd:element name="CreateAccount">
    <xsd:complexType>
      <xsd:sequence>
            <xsd:element name="field" maxOccurs="3" minOccurs="0">
              <xsd:complexType>
                <xsd:simpleContent>
                  <xsd:extension base="xsd:string">
                    <xsd:attribute type="xsd:string" name="name" use="required"/>
                  </xsd:extension>
                </xsd:simpleContent>
              </xsd:complexType>
            </xsd:element>
         </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

But when I try to open WSDL url, it show 但是当我尝试打开W​​SDL URL时,它显示

Fault - makeTypeElement() was told to create a type "{../XYZService/}>>CreateAccount>field", with no containing element 错误-告诉makeTypeElement()创建类型“ {../XYZService/}>>CreateAccount>field”,不包含任何元素

I tried Googling but not get the proper result. 我尝试了谷歌搜索,但没有得到正确的结果。 What is causing this and how can I fix it? 是什么原因造成的,我该如何解决?

尝试如下更改您的attribute元素。
<xsd:attribute type="xsd:string" name="name" use="required" />

I got it. 我知道了。 I think its a bug with Axis. 我认为这是Axis的错误。 I tried it with Axis2, it is working fine. 我在Axis2上尝试过,它工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM