Forum Discussion

granaker's avatar
13 years ago

Underscore in URL results in NullPointerException

Hi

When sending requests to a URL that contains the '_' character soapUI 4.5.0 fails with "ERROR:java.lang.NullPointerException". The endpoint I'm consuming is located at a URL in the following format "http://a_sub_domain.domain.se/serviceName.asmx"

The service works fine when communicating with WCF or viewing the WSDL with a browser.
  • The answer provided in another post on this topic was that underscores are technically not legal characters for hostnames. Since they are valid in DNS entries, however, the application should handle this more gracefully than throwing a NullPointerException with no additional information provided.

    A good use case for this is where services are located behind a load balancer that is replicated to provide fault tolerance. In this case the target "hostname" must be a virtual name that is resolved by DNS to point to whichever load balancer is currently active. Many organizations seem to put underscores in these virtual names for some reason.