I am working with Java Web Services. I got a task to create web service which will send the SOAP request in following format.
我正在使用Java Web Services。我有一个创建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
但是当我尝试打开WSDL 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?
我尝试使用谷歌搜索,但没有得到正确的结果。造成这种情况的原因是什么?如何解决?
2 个解决方案
#1
0
Try change your attribute element as below. <xsd:attribute type="xsd:string" name="name" use="required" />
尝试更改您的属性元素,如下所示。
#2
0
I got it. I think its a bug with Axis. I tried it with Axis2, it is working fine.
我知道了。我认为这是Axis的一个错误。我用Axis2试了一下,它运行正常。
#1
0
Try change your attribute element as below. <xsd:attribute type="xsd:string" name="name" use="required" />
尝试更改您的属性元素,如下所示。
#2
0
I got it. I think its a bug with Axis. I tried it with Axis2, it is working fine.
我知道了。我认为这是Axis的一个错误。我用Axis2试了一下,它运行正常。