RPC Request for get-schema of bbf(broadband forum) yangs - ietf-netconf

I am trying below RPC request for module bbf-dot1q-types. but facing error like identifier is not found.
Please help me on this to what is the right RPC request for bbf yangs.
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
<identifier>bbf-dot1q-types</identifier>
</get-schema>
</rpc>
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>invalid-value</error-tag>
<error-severity>error</error-severity>
<error-info>
<err-element>identifier</err-element>
</error-info>
<error-message>
MINOR: MGMT_CORE #2301: Invalid element value
</error-message>
</rpc-error>
</rpc-reply>

Seems like the Netconf server handling your request does not have the bbf-dot1q-types module loaded. See RFC 6022, 3.1. The <get-schema> Operation:
If the requested schema does not exist, the <error-tag> is 'invalid-value'.
Make sure the Netconf server loads the module.

Related

How can I add WS-A adressing to a SOAP webservice-request via Robot Framework?

I am new with Robot Framework and I run into a problem.
I try to call a web service that requires WSA (Web Service Addressing).
I tried sending a request while using SoapUI.
Sending a request via SoapUI provides a <wsa:Action>, a <wsa:RelatesTo> and a <wsa:MessageID> tag in the header when WSA is enabled.
Now I want to do the same with RobotFramework.
How can I inject these same tags via Robot Framework?
Here is my test
*** Settings ***
Library SudsLibrary
Library Collections
Library String
*** Test Cases ***
test
[Tags] blah
Create Soap Client C:${/}Robot WS${/}WS${/}wsdl${/}C60W30A.wsdl
Set Http Authentication MyUID MyPWD
${C60W30A}= Create Wsdl Object ns0:Invoer
${taimen}= Set Soap Headers "wsa:Action" GenBetKenmOperation
Set Wsdl Object Attribute ${C60W30A} Functie 04
Set Wsdl Object Attribute ${C60W30A} Bronsysteem COA
Set Wsdl Object Attribute ${C60W30A} Gebruiker WILLT10
${result}= Call Soap Method GenBetKenmOperation ${C60W30A}
Where the resulting XML is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.MyCompany.nl/inning/coa/GenererenBetKenmerk" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns0:Body>
<ns1:GenererenBetKenm>
<Invoer>
<Functie>04</Functie>
<Bronsysteem>COA</Bronsysteem>
<Gebruiker>GeBrID</Gebruiker>
</Invoer>
</ns1:GenererenBetKenm>
</ns0:Body>
</SOAP-ENV:Envelope>
And the error:
FAIL : WebFault: Server raised fault: 'A required header representing a Message Addressing Property is not present'
As you can see the <wsa:Action> tag is missing. As wel are the other SOAP-header tags when I add them.

JMeter changing my namespace

I'm trying to use JMeter to invoke a RPC/SOAP Web service and when I invoke the service my namespaces are mangled from the actual values to NS1.
<?xml version="1.0" encoding="UTF-8"?>
<wpc:invoke xmlns:wpc="http://wpc.ibm.com">
<wpc:envelope communicationVersion="5.3">
<wpc:WPCResponseType>asynchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>mycompany</wpc:companyName>
<wpc:wpsUserID>me</wpc:wpsUserID>
<wpc:wpcUserID>wpcUsername</wpc:wpcUserID>
<wpc:password />
<wpc:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</wpc:messageIdentifier>
<wpc:timestamp>2016-01-18</wpc:timestamp>
<wpc:supplierId><![CDATA[0Z188]]></wpc:supplierId>
<wpc:localeForDisplay>en_US</wpc:localeForDisplay>
<wpc:localeRestriction>en_US</wpc:localeRestriction>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand mode="ASYNC" type="UPLOAD">
<wpc:wpcCatalogName>Item Transaction Catalog</wpc:wpcCatalogName>
<wpc:wpcFileDocStorePath>test_data/upload/0003_items.csv</wpc:wpcFileDocStorePath>
<wpc:wpcUpdateOnly>false</wpc:wpcUpdateOnly>
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
</wpc:invoke>
Changes to:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:invoke xmlns:ns1="http://wpc.ibm.com">
<ns1:envelope communicationVersion="5.3">
<ns1:WPCResponseType>asynchronous</ns1:WPCResponseType>
<ns1:wpcHeader>
<ns1:companyName>mycompany</ns1:companyName>
<ns1:wpsUserID>me</ns1:wpsUserID>
<ns1:wpcUserID>wpcUsername</ns1:wpcUserID>
<ns1:password/>
<ns1:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</ns1:messageIdentifier>
<ns1:timestamp>2016-01-18</ns1:timestamp>
<ns1:supplierId><![CDATA[0Z188]]></ns1:supplierId>
<ns1:localeForDisplay>en_US</ns1:localeForDisplay>
<ns1:localeRestriction>en_US</ns1:localeRestriction>
</ns1:wpcHeader>
<ns1:wpcBody>
<ns1:wpcCommand mode="ASYNC" type="UPLOAD">
<ns1:wpcCatalogName>Item Transaction Catalog</ns1:wpcCatalogName>
<ns1:wpcFileDocStorePath>test_data/upload/0003_items.csv</ns1:wpcFileDocStorePath>
<ns1:wpcUpdateOnly>false</ns1:wpcUpdateOnly>
</ns1:wpcCommand>
</ns1:wpcBody>
</ns1:envelope>
</ns1:invoke>
There must be a setting in JMeter to keep the message from being transformed from my original meaningful namespace to this arbitrary namespace called NS1? When the message is received at the target endpoint it cannot parse the request because of this semantic error.
Any/all replies are appreciated!
MG
JMeter should not change anything in the request body, maybe it is an issues with your web service? Double check the request which is being sent by JMeter using a sniffer tool like Wireshark
In any case try switching to HTTP Request sampler, this is recommended way of sending web service requests (just don't forget to add HTTP Header Manager to send Content-Type and SOAPAction headers).
References:
JMeter User's Manual: Building a SOAP WebService Test Plan
Testing SOAP/REST Web Services Using JMeter

Apache CXF (Mule) Invalid QName in mapping: SOAP-ENV:Client

I'm using Apache CXF 2.5.9 within Mule ESB 3.5.0 CE for a Web Service client. If the soap message validation fails on server I get a soap fault (naturally) that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>https://10.1.104.105:8444/DohvatiIzOIBaF2FAServiceTest: cvc-simple-type 1: element {http://www.apis-it.hr/fin/2008/elements/DohvatIzOIBa}OIB value '716500116650' is not a valid instance of type {http://www.apis-it.hr/fin/2008/types/f63}String11BrojType</faultstring>
<faultactor>OIB CIS pristupni čvor</faultactor>
</soapenv:Fault>
..but when client side tries to unmarshall the fault I get this exception:
2014-12-13 13:52:34,199 [WARN] org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://www.apis-it.hr/fin/2010/services/DohvatiIzOIBaF2FAService}DohvatiIzOIBaF2ServicePortTypeService#{http://www.apis-it.hr/fin/2010/services/DohvatiIzOIBaF2FAService}DohvatiFOPoOIBu has thrown exception, unwinding now
java.lang.RuntimeException: Invalid QName in mapping: SOAP-ENV:Client
at org.apache.cxf.staxutils.StaxUtils.readQName(StaxUtils.java:1399)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:59)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:114)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:801)
I want the CXF client to unmarshall the soap fault to exception. How to get around this error?
Try making SOAP-ENV:Client something like this 12345, making the fault code a number solved it for me.
Mule won't catch the exception itself.
You should probably use a cxf fault interceptor. From there you can compose the message you are expecting.
Alternativly you could use the CXF transform feature
You need:
<entry key="faultcode" value="faultcode=soapenv:Client"/>
This will map the original invalid fault from the server into the following valid fault so that it can be accepted by the cxf client
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>An error occurred</faultstring>
</soapenv:Fault>

Having no success calling SetPolicies via SOAP SSRS 2010 API

I'm having a heck of a time calling SetPolicies() (API ref) using the 2010 SSRS WSDL (on SQL Server 2008R2 SSRS Server). When I POST with the following payload, I get a 200 response, a well formed SOAP response with an empty body, but no policy actually created for the given folder.
I'm making other calls successfully, so I'm not worried about auth problems. Additionally, I've made the same calls via Powershell with success.
I'm trying to use the raw SOAP API (called from Ruby actually)...anybody have any suggestions on what to try next?
Here's my XML:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SetPolicies>
<tns:ItemPath>/mydir</tns:ItemPath>
<tns:Policies>
<tns:groupUserName>mydomain\someuser</tns:groupUserName>
<tns:roles>
<tns:role>
<tns:name>Content Manager</tns:name>
<tns:description>stuff</tns:description>
</tns:role>
<tns:role>
<tns:name>Browser</tns:name>
<tns:description>stuff here too</tns:description>
</tns:role>
</tns:roles>
</tns:Policies>
</tns:SetPolicies>
</env:Body>
</env:Envelope>
Solved. I was able to catch the POST powershell is using (via wireshark) and look at the XML...the tags are identical, except for casing...
Looks like the reportServer API is sensitive to the case of the XML tags...when POSTing this, I get a 200, and the policies are actually set:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SetPolicies>
<tns:ItemPath>/mydir</tns:ItemPath>
<tns:Policies>
<tns:GroupUserName>mydomain\someuser</tns:groupUserName>
<tns:Roles>
<tns:Role>
<tns:Name>Content Manager</tns:name>
<tns:Description>stuff</tns:description>
</tns:Role>
<tns:Role>
<tns:Name>Browser</tns:name>
<tns:Description>stuff here too</tns:description>
</tns:Role>
</tns:Roles>
</tns:Policies>
</tns:SetPolicies>
</env:Body>
</env:Envelope>

Hand-crafted WSDL from XSD fails in CXF: the namespace on the "QueryResponse" element, is not a valid SOAP version

I have a web service that follows some of the semantics of a SOAP service, but they don't provide a WSDL for said service. Instead, they provide an XSD, by which I'm reverse-engineering a WSDL out of. Things seemed to be going well, even so far as to be able to
create a WSDL
Import the XSD as part of the WSDL using the xsd:import tag
Create Java wrappers with CXF
Call the service.
Now, what I get when I call the service is an exception:
INFO: Creating Service {http://service.something.net/xml}QueryService from WSDL: file:/C:/mydocs/Work/project/my-service.wsdl
Aug 09, 2011 1:22:34 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://service.something.net/xml}QueryService#{http://servicesomething..../xml}QueryRequest has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: "http://service.something.net/xml", the namespace on the "QueryResponse" element, is not a valid SOAP version.
The WSDL can be found in this gist, and the XSD is something I got from the vendor.
What does the error mean? What might I have done wrong in my .wsdl file generation?
Edit 1
I have manually tested the service from the vendor service, and the response seems okay to me:
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<QueryResponse xmlns="http://service.something.net/xml">
....
</QueryResponse>
</Body>
</Envelope>
Unless I'm missing something, there should not be any reason why CXF even wants the QueryResponse to be a SOAP element, since it's namespace isn't SOAP but http://service.something.net/xml.
Where you are importing your XSD:
<wsdl:types>
<xsd:schema targetNamespace="http://service.something.net/xml">
<xsd:include schemaLocation="My-XSD.xsd" />
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://service.something.net/xml"
schemaLocation="My-XSD.xsd">
</xsd:import>
</xsd:schema>
</wsdl:types>
try this instead:
<wsdl:types>
<xs:schema targetNamespace="http://service.something.net/xml"
elementFormDefault="qualified">
<xs:import schemaLocation="My-XSD.xsd"/>
</xs:schema>
</wsdl:types>
Basically you shouldn't need the include, just the import. Also you want to specify fully qualified element form.
Hope this works.