You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Richard G. Reyes" <ri...@voxsant.com> on 2007/01/03 06:13:56 UTC

help please | client tutorial

Hi All,

 

I hope somebody here can help us to access this web services.

 

http://www.sipfoundry.org/pub/sipXconfig/ws-api-3.2/ -- PhoneService -
managePhone method.

 

We are trying to create a java client  for this service using the this ruby
template.

 

http://scm.sipfoundry.org/rep/sipX/main/sipXconfig/web/test/org/sipfoundry/s
ipxconfig/api/PhoneServiceTestApi.rb

 

Please see test_addRemoveLine

 

Some reference here.
http://sipx-wiki.calivia.com/index.php/SipX_ConfigServer_SOAP_API

 

We have successfully called the addPhone method from the PhoneService and
the addUser method of the UserService.

But the managePhone method is a it complicated for us..

 

Heres our code.

 

Service  service = new Service();
             Call     call    = (Call) service.createCall();
             call.setUsername( this.getSipAdminUsername() );
             call.setPassword(this.getSipAdminPasswd() );
             call.setTargetEndpointAddress( new
java.net.URL(this.getPhoneUrl()));
             call.setOperationName(new
QName(this.getUrnNameSpace(),"ManagePhone" ));

 

             QName qnManagePhone=new
QName(this.getUrnNameSpace(),"ManagePhone" );

 


             call.addParameter("ManagePhone",qnManagePhone,
ParameterMode.IN);
             call.setReturnType(qnManagePhone);

 

             PhoneSearch phoneSearch=new PhoneSearch();
             ManagePhone managePhone = new ManagePhone();

 

             //Create Line objects to bind user data to phone
             Line phoneLine = new Line();
             phoneLine.setUserId(vxorder.getSipUsername() );
             phoneLine.setUri(this.getUri());

 


             phoneSearch.setBySerialNumber(vxorder.getMacAddress());

             managePhone.setAddLine(phoneLine);

             managePhone.setGenerateProfiles(true);

             managePhone.setSearch(phoneSearch);

 


             call.invoke(new Object[] {managePhone});

 

 

Heres our error.

 

2007-01-03 10:56:30,594 ERROR [com.voxsant.rtbedaemon.AxisWSAddLine] -
There was an error while trying to subscribe phone to Sipx. 
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXException: Invalid element in
org.sipfoundry.sipxconfig.api.ManagePhone - ManagePhone
 faultActor: 
 faultNode: 
 faultDetail: 
 {http://xml.apache.org/axis/}hostname:voxantsipx.solegysystems.com

 

org.xml.sax.SAXException: Invalid element in
org.sipfoundry.sipxconfig.api.ManagePhone - ManagePhone
 at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:2
22)
 at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:12
9)
 at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo
ntext.java:1087)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Abst
ractSAXParser.java:633)
 at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElem
ent(XMLNSDocumentScannerImpl.java:719)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fragm
entContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
 at

 

 

Thanks in advance. 

 

Richard


RE: help please | client tutorial

Posted by "Richard G. Reyes" <ri...@voxsant.com>.
Hi All, sorry for the double post. But here below is a more accurate wsdl. Please advise on the error. Thanks.
Richard

wsdl:definitions targetNamespace="urn:ConfigService">
−
	<!--
WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)
-->
−
	<wsdl:types>
−
	<schema targetNamespace="urn:ConfigService">
−
	<complexType name="Line">
−
	<sequence>
<element name="userId" type="xsd:string"/>
<element name="uri" type="xsd:string"/>
</sequence>
</complexType>
+
	<complexType name="Phone">
−
	<sequence>
<element name="serialNumber" type="xsd:string"/>
<element name="modelId" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="description" nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="lines" nillable="true" type="impl:Line"/>
</sequence>
</complexType>
+
	<complexType name="AddPhone">
−
	<sequence>
<element name="phone" type="impl:Phone"/>
</sequence>
</complexType>
<element name="AddPhone" type="impl:AddPhone"/>
−
	<complexType name="PhoneSearch">
−
	<sequence>
<element maxOccurs="1" minOccurs="0" name="bySerialNumber" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="byGroup" type="xsd:string"/>
</sequence>
</complexType>
+
	<complexType name="FindPhone">
−
	<sequence>
<element name="search" type="impl:PhoneSearch"/>
</sequence>
</complexType>
<element name="FindPhone" type="impl:FindPhone"/>
+
	<complexType name="ArrayOfPhone">
−
	<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item" type="impl:Phone"/>
</sequence>
</complexType>
+
	<complexType name="FindPhoneResponse">
−
	<sequence>
<element name="phones" type="impl:ArrayOfPhone"/>
</sequence>
</complexType>
<element name="FindPhoneResponse" type="impl:FindPhoneResponse"/>
+
	<complexType name="Property">
−
	<sequence>
<element name="property" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
+
	<complexType name="AddExternalLine">
−
	<sequence>
<element name="userId" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="displayName" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="password" type="xsd:string"/>
<element name="registrationServer" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="voiceMail" type="xsd:string"/>
</sequence>
</complexType>
−
	<complexType name="ManagePhone">
−
	<sequence>
<element name="search" type="impl:PhoneSearch"/>
<element maxOccurs="unbounded" name="edit" type="impl:Property"/>
<element maxOccurs="1" minOccurs="0" name="deletePhone" nillable="true" type="xsd:boolean"/>
<element maxOccurs="1" minOccurs="0" name="addGroup" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="removeGroup" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="addLine" nillable="true" type="impl:Line"/>
<element maxOccurs="1" minOccurs="0" name="addExternalLine" nillable="true" type="impl:AddExternalLine"/>
<element maxOccurs="1" minOccurs="0" name="removeLineByUserId" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="removeLineByUri" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="generateProfiles" nillable="true" type="xsd:boolean"/>
<element maxOccurs="1" minOccurs="0" name="restart" nillable="true" type="xsd:boolean"/>
</sequence>
</complexType>
<element name="ManagePhone" type="impl:ManagePhone"/>
</schema>
</wsdl:types>
−
	<wsdl:message name="findPhoneResponse">
<wsdl:part element="impl:FindPhoneResponse" name="FindPhoneResponse"/>
</wsdl:message>
<wsdl:message name="managePhoneResponse">

   </wsdl:message>
−
	<wsdl:message name="managePhoneRequest">
<wsdl:part element="impl:ManagePhone" name="ManagePhone"/>
</wsdl:message>
−
	<wsdl:message name="findPhoneRequest">
<wsdl:part element="impl:FindPhone" name="FindPhone"/>
</wsdl:message>
<wsdl:message name="addPhoneResponse">

   </wsdl:message>
−
	<wsdl:message name="addPhoneRequest">
<wsdl:part element="impl:AddPhone" name="AddPhone"/>
</wsdl:message>
−
	<wsdl:portType name="PhoneService">
−
	<wsdl:operation name="addPhone" parameterOrder="AddPhone">
<wsdl:input message="impl:addPhoneRequest" name="addPhoneRequest"/>
<wsdl:output message="impl:addPhoneResponse" name="addPhoneResponse"/>
</wsdl:operation>
−
	<wsdl:operation name="findPhone" parameterOrder="FindPhone">
<wsdl:input message="impl:findPhoneRequest" name="findPhoneRequest"/>
<wsdl:output message="impl:findPhoneResponse" name="findPhoneResponse"/>
</wsdl:operation>
−
	<wsdl:operation name="managePhone" parameterOrder="ManagePhone">
<wsdl:input message="impl:managePhoneRequest" name="managePhoneRequest"/>
<wsdl:output message="impl:managePhoneResponse" name="managePhoneResponse"/>
</wsdl:operation>
</wsdl:portType>
−
	<wsdl:binding name="PhoneServiceSoapBinding" type="impl:PhoneService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
−
	<wsdl:operation name="addPhone">
<wsdlsoap:operation soapAction=""/>
−
	<wsdl:input name="addPhoneRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
−
	<wsdl:output name="addPhoneResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
	<wsdl:operation name="findPhone">
<wsdlsoap:operation soapAction=""/>
−
	<wsdl:input name="findPhoneRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
−
	<wsdl:output name="findPhoneResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
	<wsdl:operation name="managePhone">
<wsdlsoap:operation soapAction=""/>
−
	<wsdl:input name="managePhoneRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
−
	<wsdl:output name="managePhoneResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
	<wsdl:service name="ConfigImplService">
−
	<wsdl:port binding="impl:PhoneServiceSoapBinding" name="PhoneService">
<wsdlsoap:address location="https:xxxPhoneService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

> -----Original Message-----
> From: Ramesh Gurunathan [mailto:ramesh.gurunathan@gmail.com]
> Sent: Wednesday, January 03, 2007 1:35 PM
> To: axis-user@ws.apache.org
> Subject: Re: help please | client tutorial
> 
> The WSDL documentation is very nice :-)
> 
> On 1/3/07, Richard G. Reyes <ri...@voxsant.com> wrote:
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: help please | client tutorial

Posted by Ramesh Gurunathan <ra...@gmail.com>.
The WSDL documentation is very nice :-)

On 1/3/07, Richard G. Reyes <ri...@voxsant.com> wrote:
>
>
>
>
> Hi All,
>
>
>
> I hope somebody here can help us to access this web services…
>
>
>
> http://www.sipfoundry.org/pub/sipXconfig/ws-api-3.2/ --
> PhoneService – managePhone method.
>
>
>
> We are trying to create a java client  for this service using the this ruby
> template…
>
>
>
> http://scm.sipfoundry.org/rep/sipX/main/sipXconfig/web/test/org/sipfoundry/sipxconfig/api/PhoneServiceTestApi.rb
>
>
>
> Please see test_addRemoveLine
>
>
>
> Some reference here…
> http://sipx-wiki.calivia.com/index.php/SipX_ConfigServer_SOAP_API
>
>
>
> We have successfully called the addPhone method from the PhoneService and
> the addUser method of the UserService.
>
> But the managePhone method is a it complicated for us..
>
>
>
> Heres our code…
>
>
>
> Service  service = new Service();
>               Call     call    = (Call) service.createCall();
>               call.setUsername( this.getSipAdminUsername() );
>               call.setPassword(this.getSipAdminPasswd() );
>               call.setTargetEndpointAddress( new
> java.net.URL(this.getPhoneUrl()));
>               call.setOperationName(new
> QName(this.getUrnNameSpace(),"ManagePhone" ));
>
>
>
>              QName qnManagePhone=new
> QName(this.getUrnNameSpace(),"ManagePhone" );
>
>
>
>
>               call.addParameter("ManagePhone",qnManagePhone,
> ParameterMode.IN);
>               call.setReturnType(qnManagePhone);
>
>
>
>              PhoneSearch phoneSearch=new PhoneSearch();
>               ManagePhone managePhone = new ManagePhone();
>
>
>
>              //Create Line objects to bind user data to phone
>               Line phoneLine = new Line();
>               phoneLine.setUserId(vxorder.getSipUsername() );
>               phoneLine.setUri(this.getUri());
>
>
>
>
>               phoneSearch.setBySerialNumber(vxorder.getMacAddress());
>
>              managePhone.setAddLine(phoneLine);
>
>              managePhone.setGenerateProfiles(true);
>
>              managePhone.setSearch(phoneSearch);
>
>
>
>
>               call.invoke(new Object[] {managePhone});
>
>
>
>
>
> Heres our error…
>
>
>
> 2007-01-03 10:56:30,594 ERROR
> [com.voxsant.rtbedaemon.AxisWSAddLine] -  There was an
> error while trying to subscribe phone to Sipx.
>  AxisFault
>   faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>   faultSubcode:
>   faultString: org.xml.sax.SAXException: Invalid element in
> org.sipfoundry.sipxconfig.api.ManagePhone - ManagePhone
>   faultActor:
>   faultNode:
>   faultDetail:
>
> {http://xml.apache.org/axis/}hostname:voxantsipx.solegysystems.com
>
>
>
> org.xml.sax.SAXException: Invalid element in
> org.sipfoundry.sipxconfig.api.ManagePhone - ManagePhone
>   at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>   at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>   at
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>   at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
>   at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
>   at
>
>
>
>
>
> Thanks in advance.
>
>
>
> Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org