I'll admit that I don't understand the intricacies here, but suds look
like a nice library that *should* be easy to use. ;)
Here's the code I'm using:
from suds.client import Client
client = Client('https://127.0.0.1:8081')
The problem I'm seeing is that instantiating the client triggers a GET
/ request to the server, which hangs until the bowels of python socket
code decide it's timed out.
What would *normally* happen with such a request to a SOAP service?
Does anyone know? Would we get back the WSDL?
Since omapd doesn't load any WSDL files, it seems like this may be an
issue where suds is trying to be smart by requesting the WSDL, and
parsing it, before allowing us to use the instantiated Client object.
Does that sounds plausible? I'm sort of grasping at straws here.
I guess I should go find another WSDL service that "just works" and
poke around a bit.
- Terry
Dear Sarab, ArneThank you both for the files. I am having error with the metadata. And when I checked the metadata file which I got from both of you, it shows the following error.when I opened these files in Microsoft visual studioIn ifmap-2.0.wsdl<xsd:import namespace="http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2" schemaLocation="ifmap-metadata-2.0v8.xsd"></xsd:import>the part marked in red has some error and when move mouse over it it says "The schema referenced from this location in your document contains errors"and when I opened the ifmap-metadata-2.0v8.xsd, I could see that all the lines which contain <xsd:attributeGroup part shows errorExample:<xsd:attributeGroup ref="ifmap:singleValueMetadataAttributes"/>when I move the mouse over the red part it says, Namespace "http://www.trustedcomputinggroup.org/2010/IFMAP/2" is not available to be referenced in this schema"so then I tried to add this line in metadata file<xsd:import namespace="http://www.trustedcomputinggroup.org/2010/IFMAP/2" schemaLocation="ifmap-base-2.0v17.xsd"></xsd:import> in the metadata file, as shown below<?xml version="1.0" ?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:ifmap="http://www.trustedcomputinggroup.org/2010/IFMAP/2"targetNamespace="http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"><xsd:import namespace="http://www.trustedcomputinggroup.org/2010/IFMAP/2" schemaLocation="ifmap-base-2.0v17.xsd"></xsd:import><!-- Schema for IF-MAP Metadata for Network Security -->I am not sure if it is rite way to do , but after i added it the errors disappeared.Anyway even after I tried these things I get this metadata error...Message Sent:message:<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:ns0="http://www.trustedcomputinggroup.org/2010/IFMAP/2" xmlns:ns1="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"><SOAP-ENV:Header/><ns1:Body><ns0:publish session-id="636e7dc90b200bdc69574eb8c9381097"><update lifetime="session"><access-request name="131.231.128.28:636e7dc90b200bdc69574eb8c9381097"/><identity name="joe" type="username"/><metadata><meta:authenticated-as xmlns:meta="http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2" ifmap-cardinality="singleValue"/></metadata></update></ns0:publish></ns1:Body></SOAP-ENV:Envelope>IROND saysServers response to client(reply){errorResult =(ErrorResultType){_errorCode = "InvalidMetadata"errorString = "bad ifmap-cardinality"}}server log5025354 [Thread-67] DEBUG - IOException: Client closed connection5025354 [pool-1-thread-2] TRACE - EventProcessor: got work to do...5025354 [pool-1-thread-1] TRACE - EventProcessor: got work to do...5025354 [pool-1-thread-2] DEBUG - Got CloseChannelEvent for 127.0.0.1:4054:625025354 [pool-1-thread-2] DEBUG - No session found for channel5025354 [pool-1-thread-1] DEBUG - Got CloseChannelEvent for 127.0.0.1:4053:615025355 [pool-1-thread-1] DEBUG - No session found for channel5134247 [pool-1-thread-3] TRACE - EventProcessor: got work to do...5134247 [pool-1-thread-3] DEBUG - Processing TimerEvent with session-id 115134248 [pool-1-thread-3] DEBUG - Session for test will be ended because of a timeout.5134248 [pool-1-thread-3] DEBUG - EndSession: sessionid=115134248 [pool-1-thread-3] TRACE - Removing 0 session metadata objects5134248 [pool-1-thread-3] TRACE - Removing session from Publisher<publisherid=test1446614531 sessionid=11>5134249 [pool-1-thread-3] DEBUG - Update Subscriptions...5134249 [pool-1-thread-3] TRACE - Changed metadata:5134250 [pool-1-thread-3] DEBUG - Commit Changes...5134250 [pool-1-thread-3] DEBUG - Notify SubscriptionObserver about new results...OMAPD saysServers response to the client:(reply){errorResult =(ErrorResultType){_errorCode = "InvalidMetadata"}}Server log:ClientParser::~ClientParser:ClientHandler::read: Got SOAP Envelope in namespace: "http://www.w3.org/2003/05/soap-envelope"ClientHandler::readSoapEnvelope: Got SOAP Header in namespace: "http://www.w3.org/2003/05/soap-envelope"ClientHandler::readSoapEnvelope: Got SOAP Body in namespace: "http://www.w3.org/2003/05/soap-envelope"ClientHandler::readMapRequest: Got IF-MAP client request: "publish" in namespace: "http://www.trustedcomputinggroup.org/2010/IFMAP/2"ClientHandler::readIdentifier: Got access-request name: "131.231.128.28:636e7dc90b200bdc69574eb8c9381097"ClientHandler::readLink: Reading past element: "access-request" of type: "EndElement"ClientHandler::readIdentifier: Got identity name: "joe"ClientHandler::readMetadata: Got metadata element: "authenticated-as" in ns: ""ClientHandler::readMetadata: Error: metadata element has no associated namespace: "authenticated-as"ClientHandler::readMetadata: Error: metadata element does not specify ifmap-cardinality: "authenticated-as"ClientHandler::readMetadata: Seting xml for: "authenticated-as" metaXML: "<authenticated-as ifmap-timestamp="2011-04-01T13:28:20" ifmap-publisher-id="131.231.128.28"/>"ClientHandler::readMetadata: All metadata in request:"<authenticated-as ifmap-timestamp="2011-04-01T13:28:20" ifmap-publisher-id="131.231.128.28"/>"Server::readClient: Got request type: "Publish" and IF-MAP version: "IFMAPv20"Server::readClient: Client Error: "InvalidMetadata"Server::processPublish: Error in publish: "InvalidMetadata"Server::sendMapResponse: Sent reply to client:"<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ifmap="http://www.trustedcomputinggroup.org/2010/IFMAP/2"><SOAP-ENV:Body><ifmap:response><errorResult errorCode="InvalidMetadata"/></ifmap:response></SOAP-ENV:Body></SOAP-ENV:Envelope>I am not sure if the metadata file has any error. or the client is not sending the metadata properly I am trying to correct it.But would like to know if you have any suggestions about the errors in the xsd files and about the message am sending.Kind regardsJB
Thanks,
Arne
On Fri, 1 Apr 2011, Ramesh JB wrote:
> Dear Sarab, Arne
>
> Thank you both for the files. I am having error with the metadata. And when
> I checked the metadata file which I got from both of you, it shows the
> following error.
> [...]
> I am not sure if it is rite way to do , but after i added it the errors
> disappeared.
I think we did the same thing when creating code with xjc for some java
MAPCs. Don't think it hurts.
> Anyway even after I tried these things I get this metadata error...
>
> *Message Sent:*
> message:
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope xmlns:ns0="
> http://www.trustedcomputinggroup.org/2010/IFMAP/2" xmlns:ns1="
> http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="
> http://www.w3.org/2003/05/soap-envelope">
> <SOAP-ENV:Header/>
> <ns1:Body>
> <ns0:publish session-id="636e7dc90b200bdc69574eb8c9381097">
> <update lifetime="session">
> <access-request name="131.231.128.28:636
> e7dc90b200bdc69574eb8c9381097"/>
> <identity name="joe" type="username"/>
> <metadata>
> <meta:authenticated-as xmlns:meta="
> http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
> ifmap-cardinality="singleValue"/>
> </metadata>
> </update>
> </ns0:publish>
> </ns1:Body>
> </SOAP-ENV:Envelope>
Are you really sure, your client is sending this? Using soapui I can
publish this request just fine.
irond actually doesn't print the request that is coming in. If you really
want to see what is coming in, you can start irond using:
java -jar -Djavax.net.debug=all irond.jar
This will give you a bunch of output and eventually what your client is
really sending.
But actually, I think it's _much easier_ with omapd. If you set the debug
level to FFFF (not sure if that's a really meaningful value, but you get
everything this way ;) ), you'll get a line saying:
Server::readClient: Socket data:
[Here will be the request your client "actually" did send]
The log you showed of omapd does not include this part, it would be
interesting to see what was received at the server side.
> I am not sure if the metadata file has any error. or the client is not
> sending the metadata properly I am trying to correct it.
>
> But would like to know if you have any suggestions about the errors in the
> xsd files and about the message am sending.
Try to get information about the requests which arrive at the server, not
those printed by your client. Both servers didn't like what they get and
the request you showed works just fine using soapui, so something fishy
is going on. It's probably due to the missing ifmap-cardinality element,
though. The weirdness is that your client shows this attribute.
Thanks,
Arne
On Fri, 1 Apr 2011, Sarab Mattes wrote:
> Ramesh,
>
> I sent in your exact publish XML SOAP envelope and omapd accepted it. I
> don't know what to say there. Are you using omapd-0.4.1?
>
> On Fri, Apr 1, 2011 at 8:13 AM, Ramesh JB <vin...@gmail.com> wrote:
>
>> Dear Sarab, Arne
>>
>> Thank you both for the files. I am having error with the metadata. And when
>> I checked the metadata file which I got from both of you, it shows the
>> following error.
>>
>> when I opened these files in Microsoft visual studio
>>
>> In ifmap-2.0.wsdl
>> <*xsd:import* namespace="
>> http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
>> schemaLocation="ifmap-metadata-2.0v8.xsd"></xsd:import>
>> the part marked in red has some error and when move mouse over it it says
>> "The schema referenced from this location in your document contains errors"
>>
>> and when I opened the ifmap-metadata-2.0v8.xsd, I could see that all the
>> lines which contain <xsd:attributeGroup part shows error
>>
>> Example:
>> <*xsd:attributeGroup* ref="ifmap:singleValueMetadataAttributes"/>
>> when I move the mouse over the red part it says, Namespace "
>> http://www.trustedcomputinggroup.org/2010/IFMAP/2" is not available to be
>> referenced in this schema"
>>
>> so then I tried to add this line in metadata file
>> <xsd:import namespace="http://www.trustedcomputinggroup.org/2010/IFMAP/2"
>> schemaLocation="ifmap-base-2.0v17.xsd"></xsd:import> in the metadata file,
>> as shown below
>>
>> <?xml version="1.0" ?>
>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:ifmap="http://www.trustedcomputinggroup.org/2010/IFMAP/2"
>> xmlns="http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
>> targetNamespace="
>> http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2">
>> *<xsd:import namespace="http://www.trustedcomputinggroup.org/2010/IFMAP/2"
>> schemaLocation="ifmap-base-2.0v17.xsd"></xsd:import>*
>> <!-- Schema for IF-MAP Metadata for Network Security -->
>>
>> I am not sure if it is rite way to do , but after i added it the errors
>> disappeared.
>>
>> Anyway even after I tried these things I get this metadata error...
>>
>> *Message Sent:*
>> message:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <SOAP-ENV:Envelope xmlns:ns0="
>> http://www.trustedcomputinggroup.org/2010/IFMAP/2" xmlns:ns1="
>> http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="
>> http://www.w3.org/2003/05/soap-envelope">
>> <SOAP-ENV:Header/>
>> <ns1:Body>
>> <ns0:publish session-id="636e7dc90b200bdc69574eb8c9381097">
>> <update lifetime="session">
>> <access-request name="131.231.128.28:636
>> e7dc90b200bdc69574eb8c9381097"/>
>> <identity name="joe" type="username"/>
>> <metadata>
>> <meta:authenticated-as xmlns:meta="
>> http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
>> ifmap-cardinality="singleValue"/>
>> </metadata>
>> </update>
>> </ns0:publish>
>> </ns1:Body>
>> </SOAP-ENV:Envelope>
>>
>>
>> IROND says
>> *Servers response to client*
>> (reply){
>> errorResult =
>> (ErrorResultType){
>> _errorCode = "InvalidMetadata"
>> errorString = "bad ifmap-cardinality"
>> }
>> }
>>
>> *server log*
>> *
>> *
>> *
>> Servers response to the client:
>> (reply){
>> errorResult =
>> (ErrorResultType){
>> _errorCode = "InvalidMetadata"
>> }
>> }
>>
>> *
>> *Server log:*
>>> metadata for network security XSD, to the omapd Google code site<http://code.google.com/p/omapd/>