Rectangle 27 21

The biggest issue for me is that I create applications, not websites...The UI is a minor part of the problem, the big part is writing the business logic layer, and various enterprise communication components (Connecting to SAP using SOAP? No Problem!).

The .NET Toolkit allows me to program in a wonderful object oriented language (C#) and has a robust framework to help out.

VbScript is a godawful language to try and write a business application in.

However, if all you do is a simple little webform, then sure, use VbScript.

As far as your link, it basically boils down:

  • WaaWaa, I want to edit production code on the production server like an idiot.
  • WaaWaa, I don't know that deploying a single compiled DLL is all that a small site needs to deploy a asp.net app.

Basicly, its ignorance in a nutshell.

Using WSC's (Windows script components) makes this a moot point. It is perfectly possible and enjoyable to write n-tier classic ASP applications with WSCs.

Are there benefits to Classic ASP over ASP.net - Stack Overflow

asp.net asp-classic
Rectangle 27 1

When you pass an XML DOM ot the send method the Content-Type is always set to "text/xml".

If you want to control the content type then you must pass a string. Don't bother loading the XML string into a DOM only to call the xml property since that may change the content of the xml declaration. BTW what does the xml declaration look like in the XML string and are you certain that the xml is correct? The encoding on the xml declare if present should say "UTF-8".

Don't send a header CharSet it means nothing, CharSet is an attribute of the Content-Type header.

Don't use XMLHTTP from inside ASP its not safe.

strXmlToSend = "<some valid xml>" 
webserviceurl = "http://webservice.com" 
webserviceSOAPActionNameSpace = "avalidnamespace" 

Set objRequest = Server.Createobject("MSXML2.ServerXMLHTTP.3.0") 
objRequest.open "POST", webserviceurl, False 

objRequest.setRequestHeader "Content-Type", "application/soap+xml; charset=UTF-8" 
objRequest.setRequestHeader "action", webserviceSOAPActionNameSpace & "GetEstimate" 
objRequest.setRequestHeader "SOAPAction", webserviceSOAPActionNameSpace & "GetEstimate" 

objRequest.send strXmlToSend

Not sure about that "action" header either looks superflous to me. Perhaps this will still fail in some way but it shouldn't complain about the Content-Type header anymore.

Sending a 'application/soap+xml' SOAP request using Classic ASP - Stac...

soap asp-classic msxml domdocument xmlhttprequest
Rectangle 27 2

Here's what I've used successfully in the past:

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
    xmlhttp.open "POST", url, false
    xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" 
    xmlhttp.setRequestHeader "SOAPAction", "http://www.mydomain.com/myaction" 
    xmlhttp.send postdata
    xml = xmlhttp.responseText

Hi, thanks for the answer. Unfortuantly I think the problem is with formating the data that is sent, it always views it as 'text/xml' even if I specify 'application/soap+xml'. Regards

@Simon - if that's the case, you'll want to have a look at what is being posted. As shahkalpesh suggested, try fiddler to see what is being posted from your page vs. what is posted if you use a web service testing tool such as SoapUI. It could be that you are missing some important XML (such as the soap envelope for example)

Sending a 'application/soap+xml' SOAP request using Classic ASP - Stac...

soap asp-classic msxml domdocument xmlhttprequest
Rectangle 27 3

If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example.

xml - SOAP or REST for Web Services? - Stack Overflow

xml web-services rest soap
Rectangle 27 3

If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example.

xml - SOAP or REST for Web Services? - Stack Overflow

xml web-services rest soap
Rectangle 27 3

If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example.

xml - SOAP or REST for Web Services? - Stack Overflow

xml web-services rest soap
Rectangle 27 3

If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example.

xml - SOAP or REST for Web Services? - Stack Overflow

xml web-services rest soap
Rectangle 27 3

If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example.

xml - SOAP or REST for Web Services? - Stack Overflow

xml web-services rest soap
Rectangle 27 3

If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example.

xml - SOAP or REST for Web Services? - Stack Overflow

xml web-services rest soap
Rectangle 27 4

Your implementation is alright, the problem is related to your Content-Type header, in fact.

text/xml; charset=utf-8
Content-Type
application/soap+xml; charset=utf-8
httpConn.setRequestProperty("Content-Type", "application/soap+xml; charset=utf-8");

In SoapUI, it's possible to check the headers calling the request and going to the Headers tab on the bottom of the window:

Then, you can compare the differences between your application configs and the SoapUI ones.

I can't find any headers in SoapUI and I get the exact same error with this Content-Type too.

The headers are on the response side, not in the request. Make a request and check there.

application/timestamp-reply

Is there possible for you to share the endpoint? Or at least the service project at GitHub? It's very hard to guess the specificities of your implementation.

Sorry, but it is reacheable only from local network.

java - SOAP message to webservice - HTTP response code: 403 for URL - ...

java xml web-services soap trusted-timestamp
Rectangle 27 4

In a previous project I solved this problem by parsing the WSDL-file and extracting the schemas from it. The code was something like the following, it assumes that the WSDL has been read into the Source variable "wsdlSource" in some way and that the imported namespaces are declared in the "schema"-element. It would probably be a good idea to have this performed once on startup and then do the validation in a SOAPHandler.

//First create a document from the WSDL-source
    DocumentBuilder db = DocumentBuilderFactory.newInstance()
                .newDocumentBuilder();
    Document wsdlDoc = db.newDocument();

    TransformerFactory transformerFactory = TransformerFactory
                .newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    transformer.transform(wsdlSource, new DOMResult(wsdlDoc));

    //Now get the schemas from the WSDL 
    NodeList schemaNodes = wsdlDoc.getElementsByTagNameNS(
            XMLConstants.W3C_XML_SCHEMA_NS_URI, "schema");

    int nrSchemas = schemaNodes.getLength();

    Source[] schemas = new Source[nrSchemas];

    for (int i = 0; i < nrSchemas; i++) {
        schemas[i] = new DOMSource(schemaNodes.item(i));
    }

    SchemaFactory schemaFactory = SchemaFactory
            .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

    //Now we have a schema that can validate the payload
    Schema schema = schemaFactory.newSchema(schemas);
    Validator validator = schema.newValidator();

Looks like the only approach for now! Thanks for the snippet.

xml - Validating SOAP message against WSDL with multiple XSD's - Stack...

xml validation soap wsdl
Rectangle 27 6

Problems usually come from the fact that programmers does not investigate to much about what remote API needs in order to connect or authenticate.

For instance PHP resends cookies from HTTP headers automatically, but when using 'node' package, it have to be explicitly set (for instance by 'soap-cookie' package)...

using soap-cookie helped me bypass an authentication problem I was having in node, thanks a lot!

Node.js: how to consume SOAP XML web service - Stack Overflow

xml node.js soap
Rectangle 27 2

In most XPath implementations this problem is addressed by registering the namespace URI with an arbitrary prefix in the host language, but I don't see any information related to this in the XMLSearch docs (and Google isn't much help, either).

The following work-around should help in the meantime:

//*[local-name()='Image']
image

Or, more specifically (as shown in @Shawn's answer):

//*[local-name()='Image' and namespace-uri()='http://fedex.com/ws/ship/v9']

Note, however, that this would be entirely unnecessary, given some way to register the namespace with the XPath engine. For example, consider this complete Java example:

DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = domFactory.newDocumentBuilder();
Document doc = builder.parse("workbook.xml");
XPath xpath = XPathFactory.newInstance().newXPath();
NamespaceContext ctx = new NamespaceContext() {
    public String getNamespaceURI(String prefix) {
        if ("myName".equals(prefix)) {
            return "http://fedex.com/ws/ship/v9";
        } 
        return null;
    }
    public String getPrefix(String uri) {
        throw new UnsupportedOperationException();
    }
    public Iterator getPrefixes(String uri) {
        throw new UnsupportedOperationException();
    }
};
xpath.setNamespaceContext(ctx);
XPathExpression expr = xpath.compile("//myName:Image");     

NodeList nodes = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
for (int i = 0; i < nodes.getLength(); i++) {
    System.out.println("[" + nodes.item(i).getTextContent() + "]");
}
[HUGE STUFF!!!]

This code associates the prefix myName with the namespace URI http://fedex.com/ws/ship/v9. Subsequent expressions can refer to nodes in that namespace using the arbitrarily chosen prefix name:

//myName:Image

One would presume that ColdFusion supports similar functionality, but I was unable to find it in the docs. However, if such functionality does not exist, then this is a limitation of ColdFusion. In particular, it has nothing to do with XPath itself or where in the source document the namespace declaration appears.

xml - ColdFusion XmlSearch(): XPath with namespaces - Stack Overflow

xml soap xpath coldfusion
Rectangle 27 6

I disagree a bit on the trend of JSON I see here. Although JSON is an order maginitude easier, I'd venture to say it's quite limited. For example, SOAP WS is not the last thing. Indeed, between soap client/server you now have enterprise services bus, authentification scheme based on crypto, user management, timestamping requests/replies, etc. For all of this, there're some huge software platforms that provide services around SOAP (well, "web services") and will inject stuff in your XML. So although JSON is probably enough for small projects and an order of magnitude easier there, I think it becomes quite limited if you have decoupled transmission control and content (ie. you develop the content stuff, the actual server, but all the transmission is managed by another team, the authentification by one more team, deployment by yet another team). I don't know if my experience at a big corp is relevant, but I'd say that JSON won't survive there. There are too many constraints on top of the basic need of data representation. So the problem is not JSON RPC itself, the problem is it misses the additional tools to manage the complexity that arises in complex applications (not to say that what you do is not complex, it's just that the software reflects the complexity of the company that produces it)

"it misses the additional tools ..." Isn't it what REST is for?

Why use XML(SOAP) when JSON so simple and easy to handle? - Stack Over...

json soap
Rectangle 27 5

I disagree a bit on the trend of JSON I see here. Although JSON is an order maginitude easier, I'd venture to say it's quite limited. For example, SOAP WS is not the last thing. Indeed, between soap client/server you now have enterprise services bus, authentification scheme based on crypto, user management, timestamping requests/replies, etc. For all of this, there're some huge software platforms that provide services around SOAP (well, "web services") and will inject stuff in your XML. So although JSON is probably enough for small projects and an order of magnitude easier there, I think it becomes quite limited if you have decoupled transmission control and content (ie. you develop the content stuff, the actual server, but all the transmission is managed by another team, the authentification by one more team, deployment by yet another team). I don't know if my experience at a big corp is relevant, but I'd say that JSON won't survive there. There are too many constraints on top of the basic need of data representation. So the problem is not JSON RPC itself, the problem is it misses the additional tools to manage the complexity that arises in complex applications (not to say that what you do is not complex, it's just that the software reflects the complexity of the company that produces it)

"it misses the additional tools ..." Isn't it what REST is for?

Why use XML(SOAP) when JSON so simple and easy to handle? - Stack Over...

json soap
Rectangle 27 5

I disagree a bit on the trend of JSON I see here. Although JSON is an order maginitude easier, I'd venture to say it's quite limited. For example, SOAP WS is not the last thing. Indeed, between soap client/server you now have enterprise services bus, authentification scheme based on crypto, user management, timestamping requests/replies, etc. For all of this, there're some huge software platforms that provide services around SOAP (well, "web services") and will inject stuff in your XML. So although JSON is probably enough for small projects and an order of magnitude easier there, I think it becomes quite limited if you have decoupled transmission control and content (ie. you develop the content stuff, the actual server, but all the transmission is managed by another team, the authentification by one more team, deployment by yet another team). I don't know if my experience at a big corp is relevant, but I'd say that JSON won't survive there. There are too many constraints on top of the basic need of data representation. So the problem is not JSON RPC itself, the problem is it misses the additional tools to manage the complexity that arises in complex applications (not to say that what you do is not complex, it's just that the software reflects the complexity of the company that produces it)

"it misses the additional tools ..." Isn't it what REST is for?

Why use XML(SOAP) when JSON so simple and easy to handle? - Stack Over...

json soap
Rectangle 27 18

OK. I managed to fully solve this problem. I have extracted some code from soapUI and started an open-source project to support SOAP in a purely XML way in Java. The main reason behind the class extraction was to separate the code that is responsible for the generation of the SOAP messages from the rest of the soapUIs code that is tightly coupled with other modules, such as soapUIs graphical user interface, etc. You can find the project here: https://github.com/reficio/soap-ws Not only is it able to generate SOAP messages, but also provides SOAP client and server. More details here: http://www.reficio.org/projects

I couldn't manage sending parameter in request especially for java not grovy. I couldn't find any clear example or something.

There's a clear example in the sub project called (surprise, surprise) "soap-examples". There are Java and Groovy examples there: github.com/reficio/soap-ws/tree/master/soap-examples/quickstart/

@tom.bujok When I downloaded the source code I get an error in my pom.xml for the execution tag.

tanks a lot man! that's what i'm looking for for almost a year!

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

java - how to generate a SOAP message with a fully populated request f...

java web-services soap wsdl
Rectangle 27 3

It looks like your problem is that your sending your base64 encoded username/password in the soap header. It actually needs to be included in the http header. My solution is in ruby but hopefully it can help you out.

soap_client = Savon.client(
  endpoint: "https://api.five9.com/wsadmin/AdminWebService/", 
  namespace: "http://service.admin.ws.five9.com/", 
  headers: { "Authorization" => "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" }, 
  env_namespace: :soapenv, 
  namespace_identifier: :ser, 
  ssl_verify_mode: :none
)

message = { 
  "lookupCriteria" => {
"criteria" => {
      "field" => "email_address",
      "value" => "something@example.com"
    }
  }
}

response = soap_client.call(:getContactRecords, message: message)
p response.body
SOAP request: https://api.five9.com/wsadmin/AdminWebService/
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==, SOAPAction: "getContactRecords",
Content-Type: text/xml;charset=UTF-8, Content-Length: 471

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ser="http://service.admin.ws.five9.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <ser:getContactRecords>
      <lookupCriteria>
        <criteria>
          <field>email_address</field>
          <value>something@example.com</value>
        </criteria>
      </lookupCriteria>
    </ser:getContactRecords>
  </soapenv:Body>
</soapenv:Envelope>

HTTPI POST request to api.five9.com (httpclient)
SOAP response (status 200)

<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
  <env:Header></env:Header>
  <env:Body>
    <ns2:getContactRecordsResponse xmlns:ns2="http://service.admin.ws.five9.com/" xmlns:ns3="http://service.admin.ws.five9.com/v1/">
      <return>
        <fields>number1</fields>
        <fields>email_address</fields>
        <records>
          <values>
            <data>5555555555</data>
            <data>something@example.com</data>
          </values>
        </records>
      </return>
    </ns2:getContactRecordsResponse>
  </env:Body>
</env:Envelope>

php - Five9's API: How to pull reports using SOAP API and Basic Authen...

php xml api soap
Rectangle 27 1

Problem: Missmatch of namespaces in expressions

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bl="urn:ebay:apis:eBLBaseComponents" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    exclude-result-prefixes="xsl bl soapenv">

    <xsl:template match="/">
        <xsl:apply-templates select="soapenv:Envelope/soapenv:Body/bl:GetSellerListResponse/bl:ItemArray"/>
    </xsl:template>

    <xsl:template match="bl:ItemArray"><xsl:text>&#xa;</xsl:text>
        <entries entity="Product" action="import"><xsl:text>&#xa;</xsl:text>
            <xsl:for-each select="bl:Item">
                <entry externalReference="{bl:ItemID}" thirdPartyReference="{bl:ItemID}"/><xsl:text>&#xa;</xsl:text>
            </xsl:for-each>
        </entries>
    </xsl:template>
</xsl:stylesheet>

xml - How to XSLT transform a SOAP response - Stack Overflow

xml xslt soap
Rectangle 27 8

SOAP and any other protocol which uses XML generally bloats your messages quite a bit - this may or may not be a problem depending on the context.

Something like JSON would be more compact and maybe faster to serialise / deserialise - but don't use it exclusively for that reason. Do whatever you feel makes sense at the time and change it if it's a problem.

Anything which uses HTTP typically (Unless it's reusing a HTTP 1.1 keepalive connection, which many implementations do not) starts up a new TCP connection for each request; this is quite bad, especially over high latency links. HTTPS is much worse. If you have a lot of short requests from one sender to one receiver, think about how you can take this overhead out.

Using HTTP for any kind of RPC (whether SOAP or something else) is always going to incur that overhead. Other RPC protocols generally allow you to keep a connection open.

web services - Performance of SOAP vs. XML-RPC or REST - Stack Overflo...

performance web-services rest soap xml-rpc